package com.rd.p2p.mobile;

import com.qdlc.p2p.dal.dto.User;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ModelDriven;
import com.qdlc.p2p.biz.web.action.BaseAction;
import com.qdlc.p2p.dal.common.SystemConfigHelper;
import com.qdlc.p2p.dal.model.BorrowModel;

/**
 * 我要投资
 * 
 * @author cx
 * @version 2.0
 */
public class MobileInvestAction extends BaseAction<BorrowModel> implements ModelDriven<BorrowModel> {

	@Action(value = "/mobile/invest/index", results = {
			@Result(name = "index", type = "ftl", location = "/mobile/invest/index.html") })
	public String index() throws Exception {
		return "index";
	}

	@Action(value = "/mobile/filminvest/index", results = {
			@Result(name = "index", type = "ftl", location = "/mobile/invest/film.html") })
	public String filminvest() throws Exception {
		return "index";
	}

	/**
	 * 标详情页面
	 * 
	 * @return String
	 * @throws Exception
	 */
	@Action(value = "/mobile/usercenter/investDetail", results = {
			@Result(name = "detail", type = "ftl", location = "/mobile/invest/detail.html") })
	public String detail() throws Exception {
		String uuid = paramString("uuid");
		request.setAttribute("uuid", uuid);
		request.setAttribute("redPacketsRule", SystemConfigHelper.getValue(SystemConfigHelper.Nid.RED_PACKETS_RULE));
		return "detail";
	}

	/**
	 * 标详情页面
	 *
	 * @return String
	 * @throws Exception
	 */
	@Action(value = "/mobile/usercenter/filmDetail", results = {
			@Result(name = "filmDetail", type = "ftl", location = "/mobile/invest/filmDetail.html") })
	public String filmInvestDetail() throws Exception {
		String uuid = paramString("uuid");
		request.setAttribute("uuid", uuid);
		return "filmDetail";
	}

	/**
	 * 新浪实名
	 *
	 * @throws Exception
	 */
	@Action(value = "/mobile/member/app/useridentify/adapterRealName", results = {@Result(name = "realName", type = "ftl", location = "/mobile/member/useridentify/adapterRealName.html")})
	public String adapterRealName() throws Exception {
		request.setAttribute("domain", session.get("domain"));
		request.setAttribute("merchantId", session.get("merchantId"));
		request.setAttribute("terminalId", session.get("terminalId"));
		request.setAttribute("requestParams",session.get("requestParams"));
		request.setAttribute("sign", session.get("sign"));
		session.remove("domain");
		session.remove("merchantId");
		session.remove("terminalId");
		session.remove("requestParams");
		session.remove("sign");
		return "realName";
	}

}
